﻿@using cloudscribe.Web.Pagination
@model SimplCommerce.Module.WishList.Areas.WishList.ViewModels.WishListVm
@{
    ViewData["Title"] = Localizer["Wish List"];
}

@section head
{
    <link simpl-append-version="true" rel="stylesheet" href="~/modules/wishlist/private-list.css" />
}

<div class="row">
    <div class="col-md-3">
        <partial name="_AccountMenu" />
    </div>
    <div class="wishlist col-md-9">
        <h2>@Localizer["Wish List"]</h2>
        <hr />
        @if (Model.Items.TotalItems > 0)
        {
            foreach (var item in Model.Items.Data)
            {
                <div class="row item">
                    <div class="col-md-3">
                        <img alt="@item.ProductName" class="img-fluid" src="@item.ProductImage">
                    </div>
                    <div class="col-md-9">
                        <h4>@item.ProductName</h4>
                        <form>
                            <input type="hidden" name="itemId" value="@item.Id" />
                            <input type="hidden" name="productId" value="@item.ProductId" />
                            <div class="form-group row">
                                <label class="col-sm-4 col-form-label">@Localizer["Quantity"]</label>
                                <div class="col-md-8"><input type="number" name="qty" class="quantity-field" value="@item.Quantity" /></div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-4 col-form-label">@Localizer["Description"]</label>
                                <div class="col-sm-8"><textarea name="description">@item.Description</textarea></div>
                            </div>
                            <div class="form-group row">
                                <div class="offset-md-4 col-md-8">
                                    <button type="button" class="btn btn-sm btn-add-cart">@Localizer["Add to cart"]</button>
                                    <button type="button" class="btn btn-sm remove-from-wishlist">@Localizer["Remove"]</button>
                                    <button type="button" class="btn btn-sm update-wishlist">@Localizer["Update"]</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            }
            <div class="text-right">
                <a class="btn btn-primary" asp-area="WishList" asp-controller="WishList" asp-action="Share">@Localizer["Share Wish List"]</a>
            </div>
            <div>
                <cs-pager cs-paging-pagesize="@Model.Items.PageSize"
                          cs-paging-pagenumber="@Model.Items.PageNumber"
                          cs-paging-totalitems="@Model.Items.TotalItems"
                          cs-pagenumber-param="pageNumber"
                          asp-controller="WishList"
                          asp-action="PrivateList"
                          asp-route-id="@Model.Id"
                          asp-route-pageSize="@Model.Items.PageSize"
                          cs-pager-li-current-class="page-item active"
                          cs-pager-li-other-class="page-item"
                          cs-pager-li-non-active-class="page-item disabled"
                          cs-pager-link-current-class="page-link"
                          cs-pager-link-other-class="page-link"></cs-pager>
            </div>
        }
        else
        {
            <p>@Localizer["There are currently no items in your wish list."]</p>
        }
    </div>
</div>
